package com.wgchao.identityrightsmanagement.domain.organization.model;

import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName: AccountEvent
 * @author: wgchao
 * @createTime: 2020/6/9 3:15 PM
 * @Description: 账户事件
 */
@Component
public class AccountEvent {
    /**
     * 部门删除 重置账户部门
     * @param accounts
     */
    public List<Account> resetAccountOfDepartment(List<Account> accounts) {
        for(Account account : accounts){
            account.setDepartmentCode(null);
        }
        return accounts;
    }
}
